﻿var learnLan = "";
var baseLan = "";
var Desc = "";
var pageTitle = "";
function Save()
{
    if(Memberno=="")
    {
        top.location = "/user/login.htm?IsShow=1&ReturnUrl="+top.location.href;
        return;
    }    
    if(!$ValidButton$())return;
    pageTitle=$get("txtPageTitle").value;
    Desc=$get("txtDes").value;
    learnLan=$get("SelectLearn").value;
    baseLan=$get("SelectBase").value;      
    if(SaveType==1)
    {//int pageID, string pageTitle, string learnLan, string baseLan, string desc
        WebServices.WWW.Resources.UpdateResourcesPageAdmin(PageID,pageTitle,learnLan,baseLan,Desc,onsuccRSave);        
    }
    else if(SaveType==-1)
    {//string pageTitle, string learnLan, string baseLan, string desc, int totalhits, int dayhits, int weekHits, int monthHits
        WebServices.WWW.Resources.AddResourcesPage(pageTitle,learnLan,baseLan,Desc,0,0,0,0,onsuccRSave); 
        alert("aa");       
    } 
}
function onsuccRSave(result)
{
    if(result.State)
    {
        $get("Succeed").style.display="";
        $get("failure").style.display="none";
    }
    else
    {
        $get("Succeed").style.display="none";
        $get("failure").style.display="";
    }
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();

